package kr.hkit.PowerJava.chapter21.work;

class MyExceptionT extends Exception{

	public MyExceptionT(String message){super(message);}
	
}
public class MyExceptionTest {
 public static void checkNegative(int number) throws MyExceptionT{
	 if(number < 0){
	 System.out.println(new MyExceptionT("음수는 안됩니다. "));
	 }
	System.out.println("다행히 음수가 아니군요");
}
public static void main(String[] args) {
	try{
		checkNegative(1);
		checkNegative(-1);
	} catch (MyExceptionT ex){ex.printStackTrace();}
}
}
